package pailaidai.hc.com.mysvgdemo.view;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;

/**
 * Created by Administrator on 2018/4/3.
 */

public class DontPressWithParentImageView extends ImageView {
    public DontPressWithParentImageView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void setPressed(boolean pressed) {
        //if the parent is pressed,do not set to pressed
        if(pressed&&((View)getParent()).isPressed()){
            return;
        }
        super.setPressed(pressed);
    }
}
